package com.bwie.controller;

import com.bwie.pojo.Result;
import com.bwie.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @className: UserController
 * @Description: TODO
 * @version: v1.８.0
 * @author: 杜林涛
 * @date: 2025/6/11 10:04
 */
@Controller
@RequestMapping("user")
public class UserController {
    @Autowired
    UserService userService;

    //发送验证码
    @ResponseBody
    @RequestMapping("sendCode")
    public Result sendCode(String phone){
        return userService.sendCode(phone);
    }
    //登录页面
    @RequestMapping("login")
    public String login(){
        return "/user/login";
    }
    //登录
    @ResponseBody
    @RequestMapping("uLogin")
    public Result uLogin(String phone,String code){
        return userService.uLogin(phone,code);
    }
}
